Skip to main content

mergBgTask

Type

library

Description

mergBgTask is an iOS external that adds commands to start and stop background tasks on iOS. Background tasks allow your app to continue executing code while in the backgound. This external should be considered experimental as it invloves letting LiveCode go into a suspended state rather than quit which is currently unsupported by LiveCode. Your background tasks should not be blocking so that you can handle the mergBgTaskExpired message appropriately to start a new task if neccessary. Use mergNotify notifications from UIApplication such as UIApplicationDidEnterBackgroundNotification and UIApplicationWillEnterForegroundNotification to determine if your task is running in the background and therefore shouldn't do unnecessary things like update the UI (even though I have done that in the demo). mergBgTask requires UIApplicationExitsOnSuspend to be set to NO in the application plist.

Thank you for your feedback!

Was this page helpful?